<template>
    <div>
        <el-card>
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>用户管理</el-breadcrumb-item>
                <el-breadcrumb-item>用户列表</el-breadcrumb-item>
            </el-breadcrumb>
            <el-table :data="userList" border style="width: 100%" height="675"
                :header-cell-style="{ background: '#409EFF', color: '#FFF' }">
                <el-table-column prop="userId" label="用户ID" width="100"></el-table-column>
                <el-table-column prop="userName" label="用户名称" width="150"></el-table-column>
                <el-table-column prop="userTel" label="联系电话" width="150"></el-table-column>
                <el-table-column prop="openId" label="openId"></el-table-column>


                <!-- <el-table-column label="操作" width="200">
                    <template slot-scope="scope">
                        <el-button size="small" icon="el-icon-edit" @click="edit(scope.row)">修改</el-button>
                    </template>
                </el-table-column> -->
            </el-table>
            <div class="paginationBox">
                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="pageNum" :page-sizes="[20, 30, 50]" :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper" :total="total">
                </el-pagination>
            </div>
        </el-card>

    </div>
</template>
<script>
import { getAllUser } from '../../network/pc'

export default {
    name: 'couInfo',
    data() {
        return {
            userList: [],
            pageNum: 1,
            pageSize: 20,
            total: 0
        }
    },
    created() {
        this.getList()
    },
    methods: {


        getList() {

            getAllUser({
                pageNum: this.pageNum,
                pageSize: this.pageSize,
            }).then(res => {
                if (res.flag) {
                    this.userList = res.data.list

                    this.total = res.data.total
                }
            })

        },

        handleSizeChange(val) {
            this.pageSize = val
            this.getList()
        },
        handleCurrentChange(val) {
            this.pageNum = val
            this.getList()
        },


    }
}
</script>

<style lang="less" scoped>
.paginationBox {
    margin-top: 15px;
    display: flex;
    justify-content: end;
}
</style>